﻿using MovingChameLibrary.Models.TourPage;
using MovingChameLibrary.TourServiceReference;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using System.Text;

namespace MovingChameLibrary.Models
{
    public class Tour : CommonItemModel, IComparable
    {
        public Tour(int id, String title, String subtitle, byte[] imageStream, string description, int budget, TourType type, int length,
            TourScheduleGroup schedule, TourGroup group)
            : base(id, title, subtitle, imageStream)
        {
            this._description = description;
            this._schedule = schedule;
            this._group = group;
            this._budget = budget;
            this._type = type;
            this._length = length;
        }

        private TourType _type;
        public TourType Type
        {
            get { return this._type; }
            set { SetProperty(ref this._type, value, "Type"); }
        }

        private int _budget;
        public int Budget
        {
            get { return this._budget; }
            set { SetProperty(ref this._budget, value, "Budget"); }
        }

        private int _length;
        public int Length
        {
            get { return this._length; }
            set { SetProperty(ref this._length, value, "Length"); }
        }

        private string _description;
        public string Description
        {
            get { return this._description; }
            set { SetProperty(ref this._description, value, "Description"); }
        }

        private TourScheduleGroup _schedule = new TourScheduleGroup();
        public TourScheduleGroup Schedule
        {
            get { return this._schedule; }
            set { this.SetProperty(ref this._schedule, value, "Schedule"); }
        }

        private TourGroup _group;
        public TourGroup Group
        {
            get { return this._group; }
            set { this.SetProperty(ref this._group, value, "Group"); }
        }

        public int CompareTo(object anotherTour)
        {
            if (anotherTour is Tour)
                return Title.CompareTo((anotherTour as Tour).Title);
            return 1;
        }
    }
}